/*
 * Copyright (c) 2017, dhl and/or its affiliates. All rights reserved.
 * dhl PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 *
 */
package com.xd.cloud.service.core;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xd.cloud.dao.Page;
import com.xd.cloud.dao.core.OrgUserDao;
import com.xd.cloud.entity.core.OrgUser;

/**
 * 机构下的用户service
 * 
 * @author dhl
 * @since  V1.0
 * 
 */
@Service
public class OrgUserService {

	@Autowired
	private OrgUserDao orgUserDao;
	
	public OrgUser get(int id)
	{
		return orgUserDao.get(id);
	}
	
	public void remove(int id)
	{
		OrgUser c = orgUserDao.get(id);
		if (c != null)
			orgUserDao.delete(c);
	}
	public void delete(int id){
		orgUserDao.delete(id);
	}
	
	public void removeUserorg(int userid) {
		orgUserDao.removeUserorg(userid);
	}
	
	public void update(OrgUser c)
	{
		orgUserDao.update(c);
	}
	
	public void update(int id,int status,String reply)
	{
		orgUserDao.update(id, status, reply);
	}	
		
	public List<OrgUser> getAll()
	{
		return orgUserDao.getAll();
	}
	
	public OrgUser getByuserid(int userid)
	{
		return orgUserDao.getByuserid(userid);
	}
	
	public Page getAllUserByorgid(int pageNo,int pageSize,int orgid,int userid)
	{
		return orgUserDao.getAllUserByorgid(pageNo, pageSize, orgid,userid);
	}
	public Object getUserCountByorgid(int orgid){
		return orgUserDao.getUserCountByorgid(orgid);
	}

	public void save(OrgUser orgUser) {
		orgUserDao.save(orgUser);
	}

	public OrgUser getByUseridRoleid(int userid, int orgid) {
		return orgUserDao.getByUseridRoleid(userid, orgid);
	}
		
}
